package io;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;

/**
 * @author 刘牌
 * @Title:
 * @date 2022/3/214:32
 */
public class UserTest {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
//        Field[] declaredFields = User.class.getDeclaredFields();
//        User user = new User();
//        for (Field declaredField : declaredFields) {
//            String s = declaredField.toString();
//            String substring = s.substring(s.lastIndexOf(".") + 1, s.length());
//            String s1 = substring.substring(0, 1).toUpperCase()+substring.substring(1);
//            User.class.getMethod("set"+s1,String.class).invoke(user,"123");
//        }
//        System.out.println(user);
        String s = "a-b-Bc";
        String[] strings = s.split("");
        String newStr = "";
        for (int i = 0; i < strings.length; i++) {
            if (strings[i].equals("-")) strings[i + 1] = strings[i + 1].toUpperCase();
            if (!strings[i].equals("-")) newStr+=strings[i];
        }
        System.out.println(newStr);
    }
}
